package com.ants.modules.ArticleManage.mapper;

import com.ants.modules.ArticleManage.dto.ArticleManageDto;
import com.ants.modules.ArticleManage.entity.ArticleManage;
import com.ants.modules.ArticleManage.vo.ArticleManageVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * TODO
 * Author Chen
 * Date   2021/9/7 18:44
 */

public interface ArticleManageMapper extends BaseMapper<ArticleManage> {

    List<ArticleManageVo> initArticleLable(@Param("username") String username);

    List<Map<String, Object>> articleGroupByCreateTime(@Param("username") String username);

    List<ArticleManage> getArticleByTime(@Param("time") String time, @Param("username") String username);

    void updateIsIncluded(@Param("isIncluded") String isIncluded, @Param("id") String id);

    List<Map<String, Object>> articleStatisticsLineChart(@Param("username") String username, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("otherSql") String otherSql);

    List<Map<String, Object>> sortStatisticsChart();

    int getViewNumSum(@Param("username") String username);

    void updateViewsNum(@Param("id") String id);

    List<Map<String, Object>> getArticleTop5ByViewNum();

    List<Map<String, Object>> getSortTop5();

    List<Map<String, Object>> recommend();

    Map<String, String> getUserInfoByArticleId(@Param("id") String id);

    ArticleManageDto getArticleToESById(@Param("id") String id);

    List<Map<String, Object>> getWxMyLikesArticle(@Param("username") String username, @Param("offset") Integer offset);

    List<Map<String, Object>> getWxMyCollectArticle(@Param("username") String username, @Param("offset") Integer offset);

    Integer beLiked(@Param("username") String username);

    List<ArticleManageDto> getPersonMyFavoritesList(@Param("username") String username, @Param("offset") Integer offset, @Param("pageSize") int pageSize);

    List<ArticleManageDto> getAllList();

    List<ArticleManageDto> getPersonLikeList(@Param("username") String username, @Param("offset") Integer offset, @Param("pageSize") int pageSize);

    List<ArticleManageDto> getArticleByUser(@Param("username") String username, @Param("offset") Integer offset, @Param("pageSize") int pageSize);

    List<ArticleManageDto> getArticleAllByUser(@Param("username") String username);

    List<Map<String, Object>> queryHotSortBySize(@Param("pageSize") Integer pageSize);

    Integer updateArticleDelFlag(@Param("id") String id, @Param("delFalg") int delFalg);

    Integer getArticleLikeNumByUserNmae(@Param("username") String username);

    Integer getArticleFavoritesNumByUserNmae(@Param("username") String username);
}
